﻿<!--
    Dialog SanPham
    Use for create and edit SanPham
    >>> Author: viettp
-->
<Window x:Class="OODCRM.Dialogs.SanPhamDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Dialog Sản phẩm" Height="400" Width="500">
    <Grid>
        <Border Margin="5,5,5,50" CornerRadius="5">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>  
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <TextBlock Text="Mã sản phẩm (*)" Margin="5"/>
                <TextBox x:Name="tbxMaSanPham" Grid.Column="1" Margin="5"
                         MinWidth="150" Text="{Binding MaSanPham}"/>

                <TextBlock Text="Tên sản phẩm (*)" Margin="5" Grid.Row="1"/>
                <TextBox x:Name="tbxTenSanPham" Grid.Row="1" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                         Text="{Binding TenSanPham}"/>

                <TextBlock Text="Phân loại" Margin="5" Grid.Row="2"/>
                <ComboBox x:Name="cbxPhanLoai" Grid.Row="2" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedValue="{Binding PHANLOAISANPHAM}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding TenPhanLoai}"/>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <TextBlock Text="Đơn vị" Margin="5" Grid.Row="3"/>
                <TextBox x:Name="tbxDonVi" Grid.Row="3" Grid.Column="1" Margin="5"
                         Text="{Binding DonVi}"/>

                <TextBlock Text="Đơn giá" Grid.Row="3" Grid.Column="2" Margin="5"/>
                <TextBox x:Name="tbxDonGia" Grid.Row="3" Grid.Column="3" Margin="5"
                         MinWidth="150" Text="{Binding DonGia, ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>

                <TextBlock Text="Diễn giải" Grid.Row="4" Margin="5"/>
                <TextBox x:Name="tbxDienGiai" Grid.Row="4" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5" MinHeight="100"
                         Text="{Binding DienGiai}"/>

            </Grid>
        </Border>

        <CheckBox x:Name="chkNgungTheoDoi" Content="Ngừng theo dõi" Margin="5,5,5,30" 
                  VerticalAlignment="Bottom" HorizontalAlignment="Left"
                  IsChecked="{Binding NgungTheoDoi}"/>
        <Button x:Name="btnCat" Content="Cất" Margin="5,5,70,5" 
                HorizontalAlignment="Right" VerticalAlignment="Bottom"
                Width="60" IsDefault="True"/>
        <Button x:Name="btnHuyBo" Content="Huỷ bỏ" Margin="5,5,5,5" 
                HorizontalAlignment="Right" VerticalAlignment="Bottom"
                Width="60" IsCancel="True"/>

    </Grid>
</Window>
